<?
require_once 'config.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>	
	<title>Quên mật khẩu</title>
	<meta name="google-site-verification" content="gkB9RQiF61Fg779oj1do-N0_IcXutfYartJIAF7Dbtw" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta property="og:image" content=""/>
   <meta name="description" content="" />
   <meta name="keywords" content="" />
	<link type="image/x-icon" href="/favicon_home.ico" rel="icon" />
	<link rel="SHORTCUT ICON" href="/favicon_home.ico"/>   
   <link rel="stylesheet" type="text/css" href="../themes/css/base.css"/>
   <link rel="stylesheet" type="text/css" href="../themes/css/login.css"/>
   
   <script type="text/javascript" src="../themes/js/jquery.js"></script>
    <?=$analytics?>
</head>
<body>
   <div class="globalContainer">
      <?
         include('view/common/vic_header.php');
      ?>
      <div class="line"></div>
      <div class="massseo_login w1136">
         <div class="login_wrap">
            <div class="login">
            <?
               $get_hash				= getValue("hash", "str", "GET", "");
               $email				= trim(getValue("email", "str", "GET", ""));
               $user = db_first("SELECT use_name,use_security FROM users WHERE use_name ='".$email."'");
               $msgError			=	"";
               if($user != NULL){
                  $hash = md5("m8m8".$email.$user['use_security']);
                  if($hash == $get_hash){     
                     $use_security	  =  rand(111111,999999);
                     $password        =  md5("massseovn" . $use_security.$use_security);
                     $default_password = 'massseovn'.$use_security;
                     $rt = "Mật khẩu mới của bạn là : <span style='color:red'>".$default_password."</span>";
                     $rspw = new db_execute("UPDATE users SET use_password ='".$password."', use_security =".$use_security." WHERE use_name='".$email."' LIMIT 1");
                  }else {$rt = "Link không tồn tại !";}
               }else $rt = "Tài khoản ko tồn tại!"
               
            ?>
               <p class="login_title"><?=$rt?></p>
               
            </div>
         </div>
      </div>
      <div class="line"></div>
      <?
         include('view/common/vic_footer.php');
      ?>
   </div>
</body>
</html>